package net.pimpas.web.jsf.components.group;

import javax.faces.component.UIComponent;

import net.pimpas.web.jsf.components.UIComponentPimpasBaseTag;

public class UIGroupTag extends UIComponentPimpasBaseTag {

	private String title;
	private String icon;
	
	@Override
	protected void setProperties(UIComponent component) {
		UIGroup group = (UIGroup) component;
		if(this.getTitle() == null || "".equals(this.getTitle())) this.setTitle("none");
		if(this.getIcon() == null || "".equals(this.getIcon())) this.setIcon(UIGroup.DEFAULT_ICON);
		if(this.getStyleClass() == null || "".equals(this.getStyleClass())) this.setStyleClass(UIGroup.DEFAULT_STYLE_CLASS);
		
		group.setTitle(this.getTitle());
		group.setIcon(this.getIcon());
		
		super.setProperties(component);
	}
	
	@Override
	public String getComponentType() {
		return UIGroup.COMPONENT_TYPE;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
}